package bond

const (
	_father = iota
	_mother
	_husband
	_wife
	_son
	_daughter
)

type Bond uint8

func (p Bond) Father() Bond {
	return p.getBond(_father)
}

func (p Bond) Mother() Bond {
	return p.getBond(_mother)
}

func (p Bond) Husband() Bond {
	return p.getBond(_husband)
}

func (p Bond) Wife() Bond {
	return p.getBond(_wife)
}

func (p Bond) Son() Bond {
	return p.getBond(_son)
}

func (p Bond) Daughter() Bond {
	return p.getBond(_daughter)
}

func (p Bond) getBond(idx int) Bond {
	if p == Unknown {
		return Unknown
	}

	if bonds, has := _bonds[p]; has {
		return bonds[idx]
	}

	return Unknown
}
